<?php
$this->breadcrumbs=array(
	Yii::t('base','Custom')=>array('admin'),
	$model->custom_surname.''.$model->custom_name,
);
?>

<h1> <?php echo Yii::t('base', 'View Custom')." "; echo $model->custom_surname.''.$model->custom_name; ?></h1>


<?php $this->renderPartial('_custom_detail',array('model'=>$model,'modelB'=>$modelB)); ?>

<?php 
/*
$custom_id=yii::app()->request->getParam(id);
$model=Recharge::model()->find('custom_id='.$custom_id);
if($model!=""){
$this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'recharge-grid',
	'dataProvider'=>$model->search(),
	'itemsCssClass'=>'responsive table table-striped table-bordered',
	'pagerCssClass'=>'pagination pull-right',
	'cssFile'=>false,
	'columns'=>array(
		//array('name'=>'user_id','value'=>'Custom::model()->getUserName($data->user_id)'),
		//array('name'=>'custom_id','value'=>'AgentIncome::model()->getCustomName($data->custom_id)'),
		//'telephone_charges',
		//'Internet_traffic',
		//'cost',
		//'payment_Type',
		//array(
			//'class'=>'CButtonColumn',
			//'header'=>Yii::t('base','Operate'),
			//'updateButtonImageUrl'=>array('class'=>'gicon-edit'),
			//'updateButtonOptions'=>array('class'=>'btn btn-small'),
			//'viewButtonImageUrl'=>array('class'=>'gicon-edit'),
			//'viewButtonOptions'=>array('class'=>'btn btn-small'),
			//'deleteButtonImageUrl'=>array('class'=>'gicon-edit'),
			//'deleteButtonOptions'=>array('class'=>'btn btn-inverse btn-small'),
			//'template'=>'{update}{delete}',
		//),
	),
)); 
} */
?>
<?php 
	$custom_id=yii::app()->request->getParam(id);
	$model=Custom::model()->find('custom_id='.$custom_id);
	if($model->access_id!=0){
	$this->widget('zii.widgets.grid.CGridView', array(
	'id'=>'custom-grid',
	'dataProvider'=>$model->search2(),
	'itemsCssClass'=>'responsive table table-striped table-bordered',
	'pagerCssClass'=>'pagination pull-right',
	'cssFile'=>false,
	'columns'=>array(
		'custom_surname',
		'custom_name',
		array('name'=>'user_id','value'=>'Custom::model()->getUserName($data->user_id)'),	
		array('name'=>'equipment_number'),
		array('name'=>'package_id','value'=>'Custom::model()->getPackageName($data->package_id)'),
		array('name'=>'custom_id','value'=>'Custom::model()->deposit($data->user_id)'),
		'reback_time',
		'reback_address',
		'address',
 		'time',
		array('name'=>'access_id','value'=>'Custom::model()->getUserName($data->access_id)'),
		/*array(
			'class'=>'CButtonColumn',
			
			'header'=>Yii::t('base','Operate'),
			'updateButtonImageUrl'=>array('class'=>'gicon-edit'),
			'updateButtonOptions'=>array('class'=>'btn btn-small'),
			'viewButtonImageUrl'=>array('class'=>'gicon-edit'),
			'viewButtonOptions'=>array('class'=>'btn btn-small'),
			'deleteButtonImageUrl'=>array('class'=>'gicon-edit'),
			'deleteButtonOptions'=>array('class'=>'btn btn-inverse btn-small'),
			'template'=>'{view}{update}{delete}{recharge}',
			'buttons'=>array(
				'recharge'=>array(
				'label'=>Yii::t('base','Recharge'),
				'url'=>'Yii::app()->createUrl("recharge/create",array("user_id"=>$data->user_id,"custom_id"=>$data->custom_id))',
				'options'=>array('class'=>'btn btn-small'),
				'visible'=>'yii::app()->user->level==1'
				),
			)
		),*/
	),
));} 
include "credit_card_table.php";
?>
